home *** CD-ROM | disk | FTP | other *** search
- Path: watnews.watson.ibm.com!ncohen
- From: ncohen@watson.ibm.com (Norman H. Cohen)
- Newsgroups: comp.lang.ada,comp.lang.c
- Subject: Re: C/C++ knocks the crap out of Ada
- Date: 4 Mar 1996 16:03:17 GMT
- Organization: IBM T.J. Watson Research Center
- Distribution: world
- Message-ID: <4hf485$1mgv@watnews1.watson.ibm.com>
- References: <JSA.96Feb16135027@organon.com> <4gaa6l$8mk@post.gsfc.nasa.gov>
- <4gd94r$isu@mack.rt66.com> <1996Feb22.005518.13396@leeweyr.sccsi.com>
- <4gvrffINNlqo@anvil.ugrad.cs.ubc.ca>
- <4h4j31$1ga3@watnews1.watson.ibm.com> <TANMOY.96Feb29144112@qcd.lanl.gov>
- Reply-To: ncohen@watson.ibm.com
- NNTP-Posting-Host: rios8.watson.ibm.com
-
- In article <TANMOY.96Feb29144112@qcd.lanl.gov>, tanmoy@qcd.lanl.gov
- (Tanmoy Bhattacharya) writes:
-
- |> Oh what the heck! Once in a lifetime is not that bad: let me make just
- |> a single post in the language war debate.
-
- Famous last words! That's how we all started out! :-)
-
- You make much of the fact that C is far more widely used than Ada,
- gleefully repeating that point several times. However, that was never a
- point of contention. You conjecture that if Ada were more popular, more
- nonstandard dialects would have arisen. Maybe, but I doubt it. As you
- point out, the Ada standard came before the language began to be used,
- and provided a clear definition of what it means to be an implementation
- of Ada. This definition allows plenty of variation among
- implementations, but only in carefully prescribed ways; in contrast, the
- ANSI C standard came out only after several incompatible versions of the
- language were in wide use, and now you're faced with the problem of
- putting the genie back in the bottle.
-
- |> Today, the international community is agreed on a definition of
- |> C. Free ANSI C compilers are available (e.g. gcc with the -pedantic
- |> flag). Vendors are moving towards providing ANSI C as their main
- |> compiler. Specialized applications (supercomputers etc.) are also
- |> moving towards ANSI C as the base language over which to provide
- |> needed extensions. Things will change, and one should think of ANSI C
- |> as the only language that deserves to be called C anymore.
-
- You'd better tell that to Bill Gates.
-
- |> I would rather use an ugly
- |> language that grew out of standardizing the true needs of the
- |> programming community, than one designed by fiat by any single
- |> committee: and, I am firm in my belief that most often I will be
- |> correct in my choice.
-
- The Ada language was originally designed in response to a set of
- requirements promulgated by its intended users. The revision was driven
- by requirements that arose in the programming community, which provided
- plentiful input to a very open process.
-
- |> NHC: The culture in the Ada community is quite different. The need to pass a
- |>
- |> A minuscule community can have a well defined culture. A large and
- |> varied community cannot.
-
- I don't think the difference is in the size of the communities, but in
- the nature of the languages. Ada is designed specifically to facilitate
- disciplined software engineering. One cannot understand the proper use
- of Ada features without understanding data abstraction, encapsulation,
- and narrow, precisely defined interfaces. Therefore, these fundamental
- concepts are taught along with Ada. C can also be used in a disciplined
- way, of course, but the language design does not focus on this; rather,
- it focuses on ensuring microefficiency, it invites programming by side
- effect, and it glorifies the use of obscure notation.
-
- |> NHC: rigorous validation suite to be approved for use on U.S. Department of
- |> NHC: Defense projects, and the requirement in the standard itself to reject
- |> NHC: certain forms of nonconformance at compile time, have led compiler
- |>
- |> So does the C standard.
- |>
- |> NHC: writers to implement the standard strictly and consistently.
-
- Incorrect. (And please stop cutting me off in mid-sentence! :-)) The C
- standard contains to requirement to detect any form of nonconformance at
- compile time. Section 1.7 of the standard states, "A _conforming_hosted_
- _implementation_ shall accept any strictly conforming program. A
- _conforming_freestanding_implementation_ shall accept any strictly
- conforming program in which the use of the features specified in the
- library section (Section 4) is confined to the contents of the standard
- <float.h>, <limits.h>, <stdarg.h>, and <stddef.h>." The converse ("A
- conforming implementation shall reject any program that is not strictly
- conforming.") is noticeably absent. Indeed, the paragraph continues, "A
- conforming implementation may have extensions (including additional
- library functions), provided they do not alter the behavior of any
- strictly conforming program."
-
- |> No. What has lead to consistency is the small number of users with
- |> homogeneous needs.
-
- The needs of the Ada community are hardly homogeneous. Ada is
- implemented on a wide variety of processors, from supercomputers to
- embedded microprocessors and everything in between. It is used for
- applications as varied as finance, command and control, systems
- programming, computer-aided design, VLSI design, medical instrumentation,
- and virtual reality, among others.
-
- |> NHC: To the extent that Ada compiler writers have sensed the need for
- |> NHC: extensions, these extensions have been in the form of "changeable parts"
- |> NHC: anticipated by the standard--implementation-defined attributes, pragmas,
- |> NHC: and packages. Many of these implementation variations--for exmaple,
- |>
- |> One can do that when the standard can anticipate the required
- |> attributes. Did the ADA standard anticipate the need to specify how to
- |> distribute an array over 1024 nodes of a machine? In a multithreaded
- |> environment, did they anticipate how to specify which thread runs on
- |> which node? Maybe they did, because the standard is recent, but have
- |> they anticipated the next machine architecture to come along?
-
- The hooks to do this (implementation-defined pragmas) are in the language
- and defined in general enough terms to accommodate future architectures.
- Such pragmas are not portable from one implementation to another, but
- they are consistent with the standard. The Ada 95 revision codified
- existing practice by standardizing certain implementation-defined
- approaches that were of general use. Later revisions will, no doubt, do
- the same. In the mean time, the ISO working group on Ada, WG9, and its
- Uniformity Rapporteur Group (URG), work to develop and recommend common
- approaches and, where appropriate, to institute secondary standards.
-
- --
- Norman H. Cohen ncohen@watson.ibm.com
-